import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

public class Test02 {
    public StringBuilder maoPao(String s1){
        char[] arr = s1.toCharArray();
        for(int i = 0;i<s1.length()-1;i++){
            for(int j =0;j<s1.length()-1-i;j++){
                if(arr[j]>arr[j+1]){
                    char tmp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = tmp;                }
            }
        }
        StringBuilder s2 = new StringBuilder();
        for(int i = 0;i<arr.length;i++){
            s2.append(arr[i]);
        }
        return s2;
    }
    public List<List<String>> groupAnagrams(String[] strs) {


        Map<String,List> map = new HashMap<>();
        for(int i = 0;i<strs.length;i++){
            String s1 = strs[i];
            StringBuilder s2 = maoPao(s1);
            s1 = String.valueOf(s2);
            if(map.containsKey(s1)){
                List<String> list = map.get(s1);
                list.add(strs[i]);
                map.put(s1,list);
            }else{
                List<String> list = new LinkedList<>();
                list.add(strs[i]);
                map.put(s1,list);
            }
        }
        List<List<String>> list2 = new LinkedList<>();
        for(Map.Entry<String,List> map3:map.entrySet()){
            list2.add(map3.getValue());
        }
        return list2;
    }

    public static void main(String[] args) {
              char a = '1';
              char b = '2';
          char c = (char) (b-a);
       StringBuilder stringBuilder = new StringBuilder();
      String s3 =new String();
      StringBuilder  stringBuilder1 = new StringBuilder(s3);
      stringBuilder1.reverse();
    }
}
